using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace qPrintComponent
{
    //typedef struct _DRIVER_INFO_2 
    //{ 
    //    DWORD  cVersion; 
    //    LPTSTR pName; 
    //    LPTSTR pEnvironment; 
    //    LPTSTR pDriverPath; 
    //    LPTSTR pDataFile; 
    //    LPTSTR pConfigFile; 
    //} 

    public sealed class DriverInfo2 : qSafeDriverInfo
    {
        public DriverInfo2(SafeHandle PrinterHandle)
            : base(PrinterHandle,2)
        {}

        public DriverInfo2(IntPtr MemoryHandle)
            : base(MemoryHandle, 2)
        { }
        
        public override string ToString()
        {
            return Environment;
        }

        [Description(@"Specifies the operating system version for which the driver was written. Currently it can be the following. Value Meaning 3 Driver for Windows 2000/XP.")]
        public int Version
        {
            get { return GetIntField(0); }
        }
        [Description(@"The name of the driver (for example, QMS 810).")]
        public string Name
        {
            get { return GetStringField(1); }
        }
        [Description(@"The environment for which the driver was written (for example, Windows NT x86, Windows IA64, Windows x64, Windows NT R4000, Windows NT Alpha_AXP, Windows 4.0, or Windows NT PowerPC).")]
        public string Environment
        {
            get { return GetStringField(2); }
        }
        [Description(@"The file that contains the device driver (for example, C:\DRIVERS\Pscript.dll).")]
        public string DriverPath
        {
            get { return GetStringField(3); }
        }
        [Description(@"The file that contains driver data (for example, C:\DRIVERS\Qms810.ppd).")]
        public string DataFile
        {
            get { return GetStringField(4); }
        }
        [Description(@"Tthe device driver's configuration dynamic-link library (for example, C:\DRIVERS\Pscrptui.dll).")]
        public string ConfigFile
        {
            get { return GetStringField(5); }
        }
    }
}
